﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using SaleSoft.Helper;
using SaleSoft.Constants;

namespace SaleSoft.Areas.administrator.Controllers
{
    public class BaseController : Controller {
        protected override void OnActionExecuting ( ActionExecutingContext filterContext ) {
            if (filterContext.ActionDescriptor.ControllerDescriptor.ControllerName != "Login") {
                if (!SessionHelper.IsLogin()) {
                    filterContext.Result = RedirectToAction("Index", "Login");
                    ViewData[SessionConstants.ERROR_MESSAGE] = "";
                    return;
                }
            }
        }
    }
}
